Public Class ContaClick
    Inherits System.Web.UI.Page
    Private IDMenu As Long
    Private Link As String
#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not Me.IsPostBack Then
            Dim acessos As ArrayList
            If IsNothing(Session("Acessos")) Then
                acessos = New ArrayList
            Else
                acessos = Session("Acessos")
            End If

            IDMenu = Request("IDMenu")
            Link = Trim(Request("link"))
            If Not acessos.Contains(IDMenu) Then
                AtualizaAcessoPagina(IDMenu)
                acessos.Add(IDMenu)
            End If
            Session("Acessos") = acessos

            Response.Redirect(Link)

        End If

    End Sub
    Public Function AtualizaAcessoPagina(ByVal idmenu As Integer) As Integer
        Dim t As New SiteDLL.Menu

        Try

            t.IDMenu = idmenu
            t.carregar()
            t.Acessos = Val(t.Acessos) + 1
            t.salvar()
            t.efetivarTransacao()

        Catch ex As Exception
            Throw ex
        Finally
            t.Dispose()
            t = Nothing
        End Try
    End Function

End Class
